#encoding:utf-8
import Image
import ImageEnhance
import ImageFilter
import sys
import pprint
import urllib 
import urllib2
from pytesser import *
table = []
for i in range(256):
    if i < 150:
        table.append(0)
    else:
        table.append(1)

def  getword(name):
    pic=Image.open(name).convert('L').point(table,'1') 
    text = image_to_string(pic ).strip().upper();
    text=text.replace(" ", "")
    l=len(text)
    if l==3 : text='99999'
    if l==5 : text=text[0:4]
    if l==6 : text=text[1:5]
    return text

